x86/mm/sharing: Clean ups for relinquishing shared pages on destroy
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Wed, 18 Apr 2012 12:38:47 +0000 (13:38 +0100)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Wed, 18 Apr 2012 12:38:47 +0000 (13:38 +0100)
commit11d33c39eb1ef1d906d54eb3196fee60a3517258
tree25b4203ae56daf228ecc5adaa655ee4fedb79787
parent07e4376ae0cd6dff3385362b4f0ebae35762ad9d
x86/mm/sharing: Clean ups for relinquishing shared pages on destroy

When a domain is destroyed, its pages are freed in relinquish_resources in a
preemptible mode, in the context of a synchronous domctl.

P2m entries pointing to shared pages are, however, released during p2m cleanup
in an RCU callback, and in non-preemptible mode.

This is an O(n) operation for a very large n, which may include actually
freeing shared pages for which the domain is the last holder.

To improve responsiveness, move this operation to the preemtible portion of
domain destruction, during the synchronous domain_kill hypercall. And remove
the bulk of the work from the RCU callback.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/domain.c
xen/arch/x86/mm/mem_sharing.c
xen/arch/x86/mm/p2m.c
xen/include/asm-arm/mm.h
xen/include/asm-x86/domain.h
xen/include/asm-x86/mem_sharing.h
xen/include/asm-x86/p2m.h